package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import tech.aistar.entity.Evaluate;
import tech.aistar.entity.SeeRoomTrend;

import java.util.List;

public interface EvaluateMapper {
    @Select("select * from evaluate")
    List<Evaluate> selectAll();

    @Insert("insert into evaluate(agent_id,register_id) value(#{agentId},#{registerId})")
    void insert(Evaluate evaluate);

    @Update("update evaluate set agent_id=#{agentId},grade=${grade},tenant_id=#{tenantId},landlord_id=#{landlordId} where id=#{Id}")
    void  updateByPrimaryKey(Evaluate evaluate);

    @Delete("delete from evaluate where id=#{Id}")
    void deleteByPrimaryKey(Integer id);


    @Select("select * from evaluate where id=#{Id}")
    Evaluate findById(Integer integer);


    @Select("select grade from evaluate where agent_id=#{agentId}")
    List<Integer> findByagentId(Integer integer);

    @Select("select * from evaluate where register_id=#{register_id} and agent_id=#{agent_id}")
    Evaluate findByregisterId(@Param("register_id") Integer register_id,@Param("agent_id") Integer agent_id);


}
